1. Field of the Invention
The present invention generally relates to digital data processing systems, and more particularly, to such systems using messages in concurrent applications where a common database is being accessed by multiple hosts.
2. Description of the Prior Art
Often times data processing systems are used in high volume transaction operations, where multiple host systems process transactions via concurrent applications. These concurrent applications can be application groups that operate on multiple hosts and access a common database.
In a transaction processing system, a given application group processing a single transaction may process one or more input messages. In addition, the application group processing the single transaction may provide one or more output messages. Input messages can include network input messages which are created by, for example, a workstation or automatic teller machine (ATM). Input messages may also include check point messages created by the transaction being processed by the current application group to replace it""s input message, or pass off messages created by transactions being processed by other application groups. Output messages may include messages to be transmitted to a user, such as the workstation or ATM. Output messages may also include pass off messages which become input messages for other transactions being processed by other application groups, or check point messages.
Typically, if one of the concurrent hosts fails, the integrity of the application groups running on that host may be compromised. For example, a user may inadvertently cause duplicate messages or transactions to be executed, or may improperly reexecute a previous input message or transaction request. That is, if a user sends a recoverable message or transaction request to one of the application groups, the corresponding host may fail before a resulting recoverable output message is delivered back to the user. If an input message or transaction request is recoverable, the user must not resend the input message or transaction request. Rather, the user must wait until the failed host recovers, and then reestablish communication with the recovered host. This is necessary in order for the recovered input message or transaction to be reprocessed, or for the resulting output message to be delivered to the user. If the input message or transaction request is not recoverable, the user must resend the message, if the previous message did not complete successfully.
In many prior art systems, when using recoverable messages in concurrently executed applications, the user cannot readily determine whether the last input message or transaction must be resent in the event one of the hosts fails. In some cases, re-sending can cause a duplicate message to be processed. In other cases, not re-sending the request can result in an omitted request. One approach to insure the integrity of the requests is to require all workstation users with sessions on the failed host to wait until the failed host recovers. The users may then reestablish the session with the failed host and determine the status of the previous input message or transaction. A limitation of this approach is that all of the users of the failed host are penalized because they all have to wait for the failed host to recover even though many of the users did not have any outstanding messages or transaction requests pending when the host failed.
The present invention overcomes many of the disadvantages associated with the prior art by providing a method and apparatus for tracking messages and transactions communicated between a number of users and a number of hosts. The present invention enables the communication of messages and transactions without a potential of their being lost or duplicated. In the preferred embodiment, each user session corresponds with a user communicating with a host, where one or more of the hosts may be executing concurrent applications. During a first user session, a first user may communicate with a first host. If an input message or committing transaction has been received by the first host from the first user, a flag associated with the first user session is set. The counter associated with the first user session is incremented when the flag is set. Once the input message or committing transaction has been processed by the concurrent application, the flag is cleared. The counter is decremented once the flag is cleared. The counter being decremented indicates there are no dependencies during the first user session with regard to the input message. A dependency exists if the input message has been received by the host but has not yet been processed.
If the concurrent application creates an output message to be sent to the first user, a counter associated with the first user session is incremented. Once the output message is released to the first user, the counter is decremented. The counter being decremented indicates there are no dependencies during the first user session with regard to the output message. A dependency exists if the concurrent application creates an output message which has not been released to the user. The counter being zero indicates there are no dependencies during the first user session with regard to any input or output message.
In an exemplary embodiment, an output message may be created in response to an input message. For example, if an input message or committing transaction has been received by the first host from the first user, a flag associated with the first user session is set. The counter associated with the first user session is incremented when the flag is set. In the exemplary embodiment, the counter is incremented to a count of xe2x80x9c1xe2x80x9d. Next, when the concurrent application creates an output message to be sent to the first user in response to the input message, the counter associated with the first user session is incremented once again. In the exemplary embodiment, the counter is incremented to a count of xe2x80x9c2xe2x80x9d. When the input message has been processed by the concurrent application, the flag is cleared. The counter is decremented once the flag is cleared. In the exemplary embodiment, the counter is incremented to a xe2x80x9c1xe2x80x9d. Once the output message is sent to the first user, the counter is decremented. In the exemplary embodiment, the counter is incremented to a xe2x80x9c0xe2x80x9d. Thus in the exemplary embodiment, the counter being decremented to a count of xe2x80x9c0xe2x80x9d indicates there are no dependencies during the first user session with regard to the input or output message.
In the preferred embodiment, the user may establish a second user session with a second host. The second user session may be established for any number of reasons, such as the first host experiencing a failure, or the user being auto-switched to the second host. Once the second session is established, the second host may determine if there are any dependencies for the first user session with the first host. If there are dependencies, the first user session must be reestablished to resolve the dependencies. Only those sessions which have dependencies with the failed host must wait for the failed host to recover. All other sessions, including idle user sessions, may be readily transferred to another host to establish new user sessions.